/**  
* @Title: AuthorityService.java
* @Package cn.net.mtons.core.member.authority
* @Description: TODO
* @author ma jinjian  
* @date 2016年1月24日 下午7:25:27
* @version V1.0  
*/ 
package cn.net.mtons.core.member.authority;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.net.mtons.core.interfaces.authority.IAuthorityService;
import cn.net.mtons.model.entity.form.LoginForm;
import cn.net.mtons.model.entity.vo.ParameterVO;
import cn.net.mtons.persist.interfaces.authority.IAuthorityDao;

/**
 * @ClassName: AuthorityService
 * @Description: TODO
 * @author ma jinjian
 * @date 2016年1月24日 下午7:25:27
 *
 */
@Service(value="authorityService")
public class AuthorityService implements IAuthorityService {

	@SuppressWarnings("unused")
	private static Logger logger = Logger.getLogger("command");
	
	@SuppressWarnings("unused")
	private static Logger netLog = Logger.getLogger("netlog");
	
	@Autowired(required=false)
	private IAuthorityDao authorityDao;
	
	/* (non-Javadoc)
	 * @see cn.net.mtons.core.interfaces.authority.IAuthorityService#validateLogin(cn.net.mtons.model.entity.form.LoginForm)
	 */
	@Override
	public boolean validateLogin(LoginForm form) {
		System.out.println("service:"+form);
		ParameterVO vo = new ParameterVO();
		vo.put("username", form.getUsername());
		vo.put("password", form.getPassword());
		if(this.authorityDao.validate_login(vo) > 0){
			return true;
		}
		return false;
	}
}
